// 导入封装的axios
import request from '@/utils/request.js'

// 获取所有频道列表
export function getAllChannelApi () {
  return request({ url: 'channels' })
}

// 获取当前登录者频道列表
export function getUserChannelApi () {
  return request({ url: 'user/channels' })
}

// 删除频道  channelId 频道ID
export function delChannelApi (channelId) {
  return request.delete(`user/channels/${channelId}`)
}

// 添加频道
export function addChannelApi (newChannels) {
  return request.put('user/channels', {
    channels: newChannels
  })
}
